<?php
//This is the bookmark-view for the 'logged_in_user'.

echo heading("My Bookmarks", 2);

?>
<div align='middle'>
<?php
//add a bookmark in the top.

echo form_open('bookmarks/update');
$input = array('name' => 'url', 'id' => 'url', 'size'=> 20);
echo form_input($input);
echo form_submit('add bookmark','add');
echo form_close();
echo br();
?>
</div>
<?php

//time format!
$format = "%m/%d/%Y %h:%i %a";

//If 'logged_in_user' have creatied any bookmarks, it will be listed here.
if (count($results)){
	foreach ($results as $key => $list){
		echo auto_link($list->url,'url',TRUE) . br();
		$stamp = mysql_to_unix($list->created);
		echo  anchor("bookmarks/view_bookmark/".$list->id, '<small>see details') . br();

		echo "posted " . mdate($format,$stamp);
		echo " by ". $usernames[$list->user_id]. br();
		echo "</small>";



		echo br(2);


	}

}

?>